<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/overlay.css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/zotero.css"?>

<!DOCTYPE window [
	<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd">
	%zoteroDTD;
	<!ENTITY % searchboxDTD SYSTEM "chrome://zotero/locale/searchbox.dtd">
	%searchboxDTD;
]>

<window
	id="zotero-advanced-search-dialog"
	title="&zotero.toolbar.advancedSearch;"
	orient="vertical"
	persist="screenX screenY width height"
	onload="ZoteroAdvancedSearch.onLoad()"
	onunload="ZoteroAdvancedSearch.onUnload();"
	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
	xmlns:html="http://www.w3.org/1999/xhtml"
	windowtype="zotero:search"
	style="display: flex;">

	<script src="include.js"/>
	<script>
		var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
	</script>
	<script src="customElements.js"/>
	<script src="advancedSearch.js"/>

	<popupset>
		<panel is="autocomplete-richlistbox-popup"
			id="search-autocomplete-popup"
			type="autocomplete-richlistbox"
			noautofocus="true"/>
	</popupset>
	
	<vbox id="zotero-search-box-container" flex="1">
		<vbox id="zotero-search-box-controls">
			<zoterosearch id="zotero-search-box" oncommand="if (this.active) { ZoteroAdvancedSearch.search(); }" flex="1"/>
			
			<hbox id="zotero-search-buttons">
				<button label="&zotero.search.search;" default="true" oncommand="ZoteroAdvancedSearch.search()"/>
				<button label="&zotero.search.clear;" oncommand="ZoteroAdvancedSearch.clear()"/>
				<button id="zotero-search-save" label="&zotero.search.saveSearch;" oncommand="ZoteroAdvancedSearch.save()"/>
			</hbox>
		</vbox>
		<hbox class="virtualized-table-container" flex="1">
			<html:div id="zotero-items-tree"/>
		</hbox>
	</vbox>
	
	<keyset>
		<key id="key_close" key="W" modifiers="accel" oncommand="window.close()"/>
	</keyset>
</window>
